package cn.ctyun.ipush.web.controller;

import cn.ctyun.ipush.model.PictureModel;
import cn.ctyun.ipush.web.user.bo.UserModel;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by yanghongbo on 2016/7/12.
 */
@Controller
@RequestMapping
public class PicController {


    @RequestMapping(value = "picIntoPage", method = RequestMethod.GET)
    public ModelAndView intoPage(HttpSession session) {

        //算法详情
        //1、取出session 中的USER 查询 user  中的pic
        //2、查询出来是一个LIST 粒度是表
        //3、根据数据库名、URL、数据库用户名 去重
        //4、多个表 合成一个LIST 返回
        UserModel systemUserModel = new UserModel();
        try {
            Object o = session.getAttribute("userInfo");
            if (o != null) {

                systemUserModel = (UserModel) o;

                List<PictureModel> list = new ArrayList<PictureModel>();

                //传入USER 得到PICMODEL LIST

                PictureModel pic = new PictureModel();
                pic.setPicturePix("100");
                pic.setPictureFormat("PNG");





            }
            return new ModelAndView("",null);
        } catch (Exception e) {
            e.printStackTrace();
            return new ModelAndView("",null);
        }
    }

}
